<?php
/**
 * Created by PhpStorm.
 * User: yf
 * Date: 2018/8/15
 * Time: 上午10:39
 */

namespace App\HttpController;

use EasySwoole\Http\AbstractInterface\AbstractRouter;
use FastRoute\RouteCollector;
use EasySwoole\Http\Request;
use EasySwoole\Http\Response;

class Router extends AbstractRouter
{
    function initialize(RouteCollector $r)
    {
    
    	$r->get('/', 'Index/Index/index');
    	$r->get('/loadtmplate', 'Index/Index/reload');
    	$r->get('/user/{id:\d+}', 'Index/Index/user');
    	$r->get('/vcode', 'Index/Index/vcode');
    	$r->get('/CaptchaCode', 'Index/Index/CaptchaCode');
    	$r->get('/jwt', 'Index/Index/jwt');
    	$r->get('/redis', 'Index/Index/redis');
    	$r->get('/task', 'Index/Index/task');
    	$r->get('/timer', 'Index/Index/timer');
 
        $r->addGroup('/admin', function (RouteCollector $r) {
        	
        	$r->get('/', function (Request $request, Response $response) {
	            $response->write('admin/index');
	        });
	        
		    
		});


    }
}